package com.zx.mes.hyl.common.exception;

/**
 * 统一异常处理
 * @author hyl
 * @date 2017-12-16
 */
public class BaseException extends RuntimeException{

    /**
     * 自定义状态
     */
    private Integer status=200;

    public BaseException() {
        super();
    }

    public BaseException(String message) {
        super(message);
    }

    public BaseException(String message, Throwable cause) {
        super(message, cause);
    }

    public BaseException(Throwable cause) {
        super(cause);
    }

    protected BaseException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
        super(message, cause, enableSuppression, writableStackTrace);
    }

    /**
     * 自定义构造函数
     * @param message 异常信息
     * @param status 状态 200等
     */
    public BaseException(String message,Integer status){

        this(message);
        this.status=status;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }
}
